﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ForTest.aspx.cs" Inherits="ForTest" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    
    <script language="javascript" type="text/javascript">
         var timelength = 1000;
         var second = 0;

         var show = 1;
         var changetime = 10;
         var maxfind = 10;
         var picspeed = 200;
         var pictimelen = 30;
         var width = 968;
         var pictime;

         function calcTime(city, offset) {
             d = new Date();

             utc = d.getTime() + (d.getTimezoneOffset() * 60000);

             nd = new Date(utc + (3600000 * offset));

             var str = ":  ";

             if (nd.getHours() < 9) {
                 str = ":  0";
             }

             second = nd.getSeconds();
             return city + str + nd.toLocaleTimeString();
         }

         function calMyTime() {
             d = new Date();
             return d;
         }
         
         function settime() {
             var aa = document.getElementById("Label1");
             aa.innerHTML = "<span class=\"time\">" + calcTime("HK   Time", 8) + "</span>";
             var aa = document.getElementById("Label2");
             aa.innerHTML = "<span class=\"time\">" + calcTime("UK   Time", 0) + "</span>";
             var aa = document.getElementById("Label3");
             aa.innerHTML = "<span class=\"time\">" + calcTime("US   Time", -5) + "</span>";
             var aa = document.getElementById("Label4");
             aa.innerHTML = "<span class=\"time\">" + calMyTime() + "</span>";
             }
         
         function init() {
             timer = setInterval("settime()", timelength);
         }
         window.onload = function () {
             init();
         }   
</script>
</head>

<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label><p></p>
        <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label><p></p>
        <asp:Label ID="Label3" runat="server" Text="Label"></asp:Label><p></p>
        <asp:Label ID="Label4" runat="server" Text="Label"></asp:Label>
    </div>
    </form>
</body>
</html>
